import { ErrorCode } from '../constants/errorCode';

export class HttpError extends Error {
  code: ErrorCode;
  status: number;
  customMsg?: string;

  constructor(code: ErrorCode, status = 400, customMsg?: string) {
    super();
    this.code = code;
    this.status = status;
    this.customMsg = customMsg;
  }
}
